<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>选择登录方式</title>
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <script type="text/javascript">
        var FINAL_COUNT = ${fns:getDictValue('login','selfCountDown' ,'20')};
    </script>
    <%@ include file="/WEB-INF/views/include/common.jsp" %>
    <%@ include file="/WEB-INF/views/include/countDown.jsp" %>
</head>
<body>
<div class="page-header">
    <div class="row">
        <div class="col-md-offset-1 col-md-9">
            <h1>智能图书馆借还系统</h1>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-offset-2 col-md-8">
        <div class="row" style="margin-top: 100px;">
                <c:forEach items="${loginTypes}" var="loginType">
                    <div class="col-xs-6 col-md-4">
                        <c:if test="${loginType.label eq 'card'}">
                            <a class="thumbnail" href="${cts}/tologin?toPage=${toPage}&loginType=${loginType.label}">
                                <img style="width: 100px;height: 100px;margin-top: 20px;"
                                     src="${ctxStatic}/images/loginType/${loginType.label}.jpg">
                                <div style="text-align: center;font-size: 24px;color: #2b669a;margin: 10px;">
                                        ${loginType.description}
                                </div>
                            </a>
                        </c:if>
                        <c:if test="${loginType.label ne 'card'}">
                            <a class="thumbnail" style="background-color:#9d9d9d;"
                               href="javascript:void(0);"
                               onclick="layer.msg('登录方式尚未启用,请尝试其他方式!');">
                                <img style="width: 100px;height: 100px;margin-top: 20px;"
                                     src="${ctxStatic}/images/loginType/${loginType.label}.jpg">
                                <div style="text-align: center;font-size: 24px;color: #2b669a;margin: 10px;">
                                        ${loginType.description}
                                </div>
                            </a>
                        </c:if>
                    </div>
                </c:forEach>
        </div>
    </div>
</div>

<div class="form-signin">
    <script>
        document.onkeydown = function (event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];
            if (e && e.keyCode == 13) {
                $("#gide_div").html("正在处理借书证信息,请稍候...");
                $("#loginForm").submit();
            }
        };
        $(function () {
            $("body").click(function () {
                $("#rdCardno").val("").focus();
            });
            $("#rdCardno").val("").focus();
        });

    </script>
    <form id="loginForm" action="${cts}/login.do" method="post">
        <input name="toPage" value="${toPage}" style="display: none">
        <div id="card_content" class="control-group" style="margin-top: 30px;">
            <input id="rdCardno" name="rdCardno" autocomplete="off" style="position: absolute;top: -1000px;">
        </div>
    </form>
</div>

<%@ include file="/WEB-INF/views/include/footer.jsp" %>
</body>
</html>